package com.linafri;

/**
 * TODO 类实现描述
 *
 * @author wb_yanghui
 * @since 2018年8月11日 下午9:41:43
 */
class ABCThread implements Runnable {

    static final String rock = "D";
    private String      outPut;

    public ABCThread(String outPut) {
        this.outPut = outPut;
    }

    @Override
    public void run() {

        int count = 10;

        synchronized (rock) {
            while (count >= 0) {
                rock.notify();
                System.out.println("第" + count + "个:" + outPut);
                System.out.println("wait");
                try {
                    if (count-- != 0) {
                        rock.wait();
                    }

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

            }

        }

    }
}
